/*
--Escape Sequences--
\a	The ASCII bell character (you can also type \007)
\d	Date in "Wed Sep 06" format
\e	ASCII escape character (you can also type \033)
\h	First part of hostname (such as "mybox")
\H	Full hostname (such as "mybox.mydomain.com")
\j	The number of processes you've suspended in this shell by hitting ^Z
\l	The name of the shell's terminal device (such as "ttyp4")
\n	Newline
\r	Carriage return
\s	The name of the shell executable (such as "bash")
\t	Time in 24-hour format (such as "23:01:01")
\T	Time in 12-hour format (such as "11:01:01")
\@	Time in 12-hour format with am/pm
\u	Your username
\v	Version of bash (such as 2.04)
\V	Bash version, including patchlevel
\w	Current working directory (such as "/home/drobbins")
\W	The "basename" of the current working directory (such as "drobbins")
\!	Current command's position in the history buffer
\#	Command number (this will count up at each prompt, as long as you type something)
\$	If you are not root, inserts a "$"; if you are root, you get a "#"
\xxx	Inserts an ASCII character based on three-digit number xxx (replace unused digits with zeros, such as "\007")
\\	A backslash
\[	This sequence should appear before a sequence of characters that don't move the cursor (like color escape sequences). This allows bash to calculate word wrapping correctly.
\]	This sequence should appear after a sequence of non-printing characters.

--Colors--
Black 0;30
Dark Blue 0;34
Green 0;32
Cyan 0;36
Red 0;31
Purple 0;35
Brown 0;33
Yellow 1;33
White 1;37
Dark Gray 1;30
Light Blue 1;34
Light Green 1;32
Light Cyan 1;36
Light Red 1;31
Light Purple 1;35
Light Gray 0;37 
*/
using System;
using System.Collections.Generic;

namespace bashpromptutil
{
//logic to figure out bash escape sequences 	
	public class bashEscapes
	{
		//fields
		private Dictionary<string,string> _escapes;
		private Dictionary<string,string> _escapesRev;
		private Dictionary<string,string> _colors;
		
		//properties
		public Dictionary<string,string> escapes
		{
			get { return _escapes; }
		}
		
		public Dictionary<string,string> escapesRev
		{
			get { return _escapesRev; }
		}

		public Dictionary<string,string> colors
		{
			get { return _colors; }
		}
		
		//constructor
		public bashEscapes()
		{
			//list of escape sequences
			_escapes = new Dictionary<string,string>();
			_escapes.Add("asciibell",@"\a");
			_escapes.Add("date",@"\d");
			_escapes.Add("asciiesc",@"\e");
			_escapes.Add("hostnameS",@"\h");
			_escapes.Add("hostnameF",@"\H");
			_escapes.Add("susProcs",@"\j");
			_escapes.Add("termDev",@"\l");
			_escapes.Add("newline",@"\n");
			_escapes.Add("carRet",@"\r");
			_escapes.Add("shellExec",@"\s");
			_escapes.Add("time24",@"\t");
			_escapes.Add("time12",@"\T");
			_escapes.Add("time12ampm",@"\@");
			_escapes.Add("username",@"\u");
			_escapes.Add("version",@"\v");
			_escapes.Add("version2",@"\V");
			_escapes.Add("dir",@"\w");
			_escapes.Add("dirBase",@"\W");
			_escapes.Add("cmdHist",@"\!");
			_escapes.Add("cmdNum",@"\#");
			_escapes.Add("su",@"\$");
			_escapes.Add("colorBegin",@"\[");
			_escapes.Add("colorEnd",@"\]");
			
			//reversed
			_escapesRev = new Dictionary<string,string>();
			foreach(KeyValuePair<string,string> kvp in _escapes)
				_escapesRev.Add(kvp.Value,kvp.Key);
			

			_colors = new Dictionary<string,string>();
			_colors.Add("black",@"\[\e[0;30m\]");
			_colors.Add("bBlack",@"\[\e[1;30m\]");
			_colors.Add("red",@"\[\e[0;31m\]");
			_colors.Add("bRed",@"\[\e[1;31m\]");
			_colors.Add("green",@"\[\e[0;32m\]");
			_colors.Add("bGreen",@"\[\e[1;32m\]");
			_colors.Add("orange",@"\[\e[0;33m\]");
			_colors.Add("yellow",@"\[\e[1;33m\]");
			_colors.Add("blue",@"\[\e[0;34m\]");
			_colors.Add("bBlue",@"\[\e[1;34m\]");
			_colors.Add("purple",@"\[\e[0;35m\]");
			_colors.Add("bPurple",@"\[\e[1;35m\]");
			_colors.Add("cyan",@"\[\e[0;36m\]");
			_colors.Add("bCyan",@"\[\e[1;36m\]");
			_colors.Add("grey",@"\[\e[0;37m\]");
			_colors.Add("white",@"\[\e[1;37m\]");
			_colors.Add("default",@"\[\e[0m\]");
			
		}
		
		//methods

	}
	
}